<template>
	<view class="singer">
		<ul>
			<navigator 
			class="list-item" 
			v-for="item in singerList" 
			:key="item.id"
			:url="'/pages/singer-detail/singer-detail?item=' + encodeURIComponent(JSON.stringify(item))"
			>
				<image :src="item.img1v1Url" class="avatar"></image>
				<span class="name">{{ item.name }}</span>
			</navigator>
		</ul>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				singerList: []
			}
		},
		onLoad() {
			var serverUrl = this.serverUrl
			uni.request({
				url: serverUrl + '/top/artists?limit=80',
				method: "GET",
				success: (res) => {
					if(res.data.code === 200){
						this.singerList = res.data.artists
						console.log(this.singerList)
					}
				}
			})
		},
		methods: {

		}
	}
</script>

<style>
@import url('singer.css');
</style>
